package src;

import java.util.Random;
import java.util.Scanner;

public class BicolorSphere {
    public static void main(String[] args) {

        int[] arr = new int[7];

        Random r = new Random();




        for (int i = 0; i < 6; ) {
            int rad = r.nextInt(33)+1;

            boolean flag = game(rad , arr);
            if (!flag){
                arr[i] = rad;
                i++;
            }
            arr[i] = rad;
        }
        int lan = r.nextInt(16)+1;
        arr[6] = lan;


//        for (int i = 0; i < arr.length; i++) {
//            System.out.println(arr[i]);
//        }

        Scanner sc = new Scanner(System.in);

        int num =0 , mun =0;
        for (int i = 1; i < 7; i++) {
            System.out.println("请输入你第"+i+"个红球号码  ");
            int number = sc.nextInt();
            for (int i1 = 0; i1 < arr.length-1; i1++) {
                if (arr[i1] == number){
                    num++;
                }
            }

        }
        System.out.println("请输入你的蓝球号码  ");
        int number1 = sc.nextInt();
        if (arr[6] == number1)
            mun++;

        System.out.println("有红球" +  num+"个");
        System.out.println("有蓝球"+mun+"个");






    }

    public static boolean game(int rad , int[] arr) {
        for (int i = 0; i < arr.length-1; i++) {
            if (arr[i] == rad){
                return true;
            }
        }
        return false;
    }
}